<!DOCTYPE html>
<html>
  <head>
    <title>Listing 14.6</title>
    <meta charset="utf-8">
    <script type="text/javascript" src="../scripts/assert.js"></script>
    <link href="../styles/assert.css" rel="stylesheet" type="text/css">
  </head>
  <body>
    <script type="text/javascript">

      function globalEval(data) {
        data = data.replace(/^\s+|\s+$/g, "");

        if (data) {
          var head = document.getElementsByTagName("head")[0] ||
                  document.documentElement,
              script = document.createElement("script");

          script.type = "text/javascript";
          script.text = data;

          head.insertBefore(script, head.firstChild);
          head.removeChild(script);
        }
      }

    </script>
  </body>
</html>
